'use strict'

module.exports = app => {
	const { STRING, INTEGER, DATE } = app.Sequelize

	const Menu = app.model.define('menu', {
		id: { type: INTEGER, primaryKey: true, autoIncrement: true },
		pid: INTEGER,
		title: {
			type: STRING(50),
			field: '_title',
			comment: '菜单名',
		},
		icon: {
			type: STRING,
			field: '_icon',
			comment: '图标',
		},
		path: {
			type: STRING,
			field: '_path',
			comment: '路径',
		},
		roleLevel: {
			type: STRING,
			comment: '权限等级',
		},
		createdAt: DATE,
		updatedAt: DATE,
	})

	return Menu
}
